package methods01;
	class  Fruit{
		public void eat() {
			System.out.println("eat fruit");
		}
	}
	class  A extends  Fruit{
		public void eat() {
			System.out.println("eat apple");
		}
	}
public class overriding {
	
	public static void main(String[]args) {
		Fruit eat1= new Fruit(); 
		Fruit eat2= new A(); 
		eat1.eat();
		eat2.eat();
		
	}	
}
